package com.itheima.exerciseTest.method20_29.method24;

public class Demo {
    public static void main(String[] args) throws InterruptedException {
        Desk desk = new Desk();

        Foodie f = new Foodie(desk);
        for (int i = 1; i <= 9; i++) {
            Thread thread = new Thread(f);
            thread.setName("" + i);
            thread.start();
        }

        Cooker c = new Cooker(desk);
        for (int i = 1; i <= 9; i++) {
            Thread thread = new Thread(c);
            thread.setName("" + i);
            thread.start();
        }
    }
}
